<template>
    <div ref="body">
        <div style="height:30px;margin-top:3px" v-if="!readOnly&&!disabledForStop">
            <Button type="primary" style="" @click="handleAdd" :disabled="familyInfo.townshipEdit||familyInfo.isSendedHd">录入</Button>
        </div>
        <div style="margin-top:10px ">
            <vxe-table border
                       auto-resize
                       row-id="id"
                       :row-key="true"
                       show-overflow="tooltip"
                       highlight-hover-row
                       align="center"
                       header-align="center"
                       ref="xTree"
                       :loading="Loading"
                       :data="tableData">
                <vxe-table-column field="ssbc0001_name" title="被赡抚扶养人 " align="center" min-width="100"/>
                <vxe-table-column field="ssbc0002" title="义务人姓名" align="center" min-width="100"/>
                <vxe-table-column field="ssbc0004" title="义务人证件号码" align="center" min-width="200"/>
                <vxe-table-column field="ssbc0033_name" title="与申请人关系" align="center" min-width="150"/>
                <vxe-table-column field="ssbc0008" title="月赡(抚、扶)养费" align="center" min-width="100"/>
                <vxe-table-column field="ssbc0038_name" title="赡抚（扶）养费计算方式" align="center" min-width="200"/>
                <vxe-table-column title="操作" align="center" fixed="right" min-width="200">
                    <template #default="{row}">
                        <Button type="info" size="small" @click="handleEdit(row)"
                                v-if="!readOnly&&!disabledForStop">编辑
                        </Button>
                        <Button type="error" size="small" @click="handleDelete(row.id)" style="margin-left: 5px"
                                v-if="!readOnly&&!disabledForStop" :disabled="familyInfo.isSendedHd||familyInfo.townshipEdit">删除
                        </Button>
                        <Button type="success" size="small" @click="handleDetail(row)" style="margin-left:5px">详情
                        </Button>
                    </template>
                </vxe-table-column>
            </vxe-table>
            <Page :total="dataCount" :page-size="pageSize" show-total class="paging"
                  @on-change="handleTableChange" :current="pageNo"></Page>
        </div>
        <ss11005-modal ref="modalForm" @ok="modalFormOk" :type="type"/>
    </div>
</template>

<script>
    import {CommonMixin} from '@/views/common/js/CommonMixin'
    import Ss11005Modal from '../modules/Ss11005Modal1'

    export default {
        name: "ss11005-tab1",
        mixins: [CommonMixin],
        components: {
            Ss11005Modal
        },
        props: {
            familyId: {
                type: String,
                default: ""
            },
            familyInfo: {
                type: Object,
                default: function () {
                    return {}
                }
            },
            type: {
                type: Number,
                default: 11
            },
            readOnly: {
                type: Boolean,
                default: false
            },
            disabledForStop: {
                type: Boolean,
                default: false
            }
        },
        data() {
            return {
                url: {
                    list: "",
                    delete: "",
                },
                Loading: true,
                queryParam: {
                    azcp0500: this.familyId,
                },

            }
        },
        methods: {
            edit() {
                this.loadData();
            }
        },
        created() {
            this.url.list = "/api/ac/subsistence/ss" + this.type + "005Service/getPageList";
            this.url.delete = "/api/ac/subsistence/ss" + this.type + "005Service/deleteData";
            this.loadData();
            console.log(this.disabledForStop)
        },
    }


</script>

<style scoped>

</style>
